package msu.ml.data;

import msu.ml.core.*;
import weka.core.*;

/**
 *
 * The IDataPostProcessor interface provides a means
 * by which to do something useful with the results of
 * an experiment. This interface allows data to be 
 * processed on a per Instance basis, per Instances
 * basis or on a per Experiment basis.
 *
 * @author Reginald M Mead
 * @version 1.0
 */
public class DataPostProcessorAdapter implements IDataPostProcessor
{
    private Experiment e;
    public void setExperiment(Experiment e)
    {
        this.e = e;
    }

    public Experiment getExperiment() 
    { 
        return this.e;
    }

    /** Signals the beginning of an experiment to the
     * data processor. The data processor in turn does
     * any pre experiment initialization.
     */
    public void beginExperiment(Experiment e) 
    { 
        this.e = e;
    }

    /**
     * Signals that training has begun;
     * 
     * @param labels training data labels
     */
    public void beginTraining(String [] labels) { }

    /** Signals the beginning of a set of instances or
     * a sweep.
     * @param name Instances name (usually a file name)
     */
    public void beginInstances(String name) { }


    /** Signals the end of an experiment
    */
    public void endExperiment() { }


    /** Signals the end of a set of instances
    */
    public void endInstances() { }

    /**
     * Process gets called each time an instance is given
     * a class distribution.
     * @param data The instance that has just been assigned a distribution
     * @param distribution The probability distribution for potential classes
     */
    public void process(Instance data, double [] distribution) { }
}
